﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using log4net;
using Mate.Caching;
using Mate.Framework.BaseController.Admin;
using Mate.Merchant.Service;
using Microsoft.AspNetCore.Mvc;

namespace Mate.Admin.Controllers.Merchant
{
    public class StatisticsDataController : BaseController
    {
        private readonly IStatisticsDataService statisticsDataService;
        private readonly ILog log;
        private readonly ICacheManager _cache;
        public StatisticsDataController(IStatisticsDataService statisticsDataService, ICacheManager cache, ILog log)
        {
            this.log = log;
            this.statisticsDataService = statisticsDataService;
            this._cache = cache;
        }


        public IActionResult Index()
        {
            return View();
        }

        #region 获取列表
        [HttpPost]
        public IActionResult GetList(int pageIndex, int pageSize,string Key)
        {
            int recordCount = 0;
            var list = statisticsDataService.GetStatisticsDataList(pageIndex, pageSize,Key, ref recordCount);
            var result = new
            {
                rows = list,
                total = recordCount
            };
            return Json(result);
        }
        #endregion

    }
}